package cn.itlight.controller;

import cn.itlight.entity.User;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserCont {

    //浏览器调用该方法
    @RequestMapping(value = "/user/{id}",method = RequestMethod.GET)
    public User getById(@PathVariable("id")Long id){

        //发送http请求
        return new User(id,"zs:"+id,"我是zs");

    }
}
